import java.util.Scanner;

//java中的输入与输出
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextInt())
        {
            int age = scan.nextInt();
            System.out.println(age);
        }
    }
    public static void main1(String[] args) {

       // System.out.println("Hello world!");

        //导入scanner包
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入你的名字");

        //读取一个字符串
        String name = scan.next();//读入一行 遇到空格结束
        //String name = scan.nextLine();//读入一行
        System.out.println("姓名" + name);

        //读取一个int类型的整数
        System.out.println("请输入年龄");
        int age = scan.nextInt();
        System.out.println("年龄" + age);

        //读取一个float类型
        System.out.println("请输入你的工资");
        float salary = scan.nextFloat();
        System.out.println("工资" + salary);
        scan.close();
    }
}